package com.duan.blog.dao;

import com.duan.blog.model.User;
import com.duan.blog.model.vo.NamePasswordVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
import org.springframework.stereotype.Service;

import java.util.List;

@Repository
public interface UserMapper {
    //查询用户
    User selectUserById(int id);
    List<User> selectAllUser();
    //根据用户名查询用户名和密码
    @Select("select user_name as userName, user_password as userPassword from my_user where user_name = #{name} ")
    NamePasswordVo selectNameAndPasswordByName(@Param("name") String name);
    //增加用户
    String addUser(User user);
    String addAllUser(List<User> users);
    //删除用户
    String delUserById(int id);
    //更新用户
    String updateUser(User user);




}
